home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
utils
/
mt100.zip
/
MT.TXT
< prev
next >
Wrap
Text File
|
1996-06-04
|
7KB
|
152 lines
MT - Move To drive/directory
Copyright Jason Hood 1996
Freeware
Description
mt is a complete CD replacement. It allows for the use of slash ("/") as well
as backslash ("\") in directory names. The dot notation has been extended so
"grandparent" and "great-grandparent", etc., can be specified. Partial
directory names are supported. The two previous directories are remembered.
And of course, the drive can be changed.
Requirements
DOS 3.0+
286+ (but could be recompiled/reassembled for less)
Installation
Place mt.com in your path. It doesn't really matter where the other files go.
Add these two statements to your autoexec.bat:
SET MTMEM=####
[path]mtmem.com [d:/path] [;prev] [;;bprev]
where: the environment variable will be set to the resident memory segment;
[path] is the path to mtmem.com;
[d:/path] is the drive and path to place the directory structure file;
[;prev] & [;;bprev] are the initial previous directories.
If [d:/path] is not specified, it will default to the same path as mtmem.com.
If the previous directories are not specified they will be set to nothing.
Memory will be allocated high (if available), using best fit. (The memory is
used to store the path and previous directories.)
The next step is to setup the directory structure file for the partial names:
mt @drives
where drives is the list of drives you wish to scan. Note that the drives
will be scanned in the order specified and I make no test for invalid drives.
I've allowed for 1500 directories per drive. (It can hold about 1512 with an
average length of about 20.) If you have more than 1500 directories, it will
probably crash, 'coz I've not tested for that either.
Usage
"mt ?" or "mt <any-character-of-your-choice>?" will display a help screen
(at least, I hope it helps).
"mt @cd", for example, will scan drives C: and D:. "mt @" will update the
file for drives previously scanned (by totally rescanning the drives). The
file's path can be changed via mtmem.com.
"mt ..." is equivalent to "mt ../.." - ie. it will move you to the "grand-
parent" directory. Any number of dots can be specified, but of course it will
fail if you try to move too far back. Note that the extra dots will only work
at the start of the path - if specified in the middle you will get an error
(but it's a silly thing to do anyway).
"mt;" (or "mt ;" if you like typing spaces) will move you to the directory you
just moved from. Similarly "mt;;" goes to the one before the previous
directory. I don't think I explained that too well, so here's an example:
C:\>mt utils
C:\UTILS>mt /games
C:\GAMES>mt; move to the directory you just moved from
C:\UTILS>mt;; move to the directory you moved from before
C:\> the one you just moved from
I think I could still phrase it better, but you should get the idea. The
intelligence of the previous directories is not too good, so if you do some-
thing like "mt ." it will set the previous directory to the current directory.
The only test I make is if the previous is the current ('coz of Windows always
going to its own directory). mtmem.com can also set the previous directories.
"mt d:path" is the same as CD, but it will change drive as well. You can also
use slashes. "mt d:\games\dos" is the same as "mt d:/games/dos". It is also
possible to use a star ("*") for the last directory name. It will select the
first name that matches (in the file table, not alphabetically). So if the
above games directory has dos and windows as subdirectories, and dos is first
in the file table, then "mt d:/games/*" will get you there. Similarly, "mt
d:/games/w*" will move you to the windows subdirectory.
"mt name1 name2 ..." (that's an ellipsis, not grandparent) is roughly equiv-
alent to "mt name1*/name2*/..." - ie. it looks for a directory that starts
with name1, has a subdirectory that starts with name2, etc. Note that if only
one name is specified it looks for a subdirectory before it starts the search.
Searches always begin from the root, in drive order (when the structure file
was created). To specify another drive: "mt d:name1 name2 ..." where d is
the drive you want. The first match found will be the one selected. If it's
not the one you want, you will need to narrow the search (by specifying more
characters). (I find it easier to type than to select from a damn annoying
pop-up window.) Directories are stored alphabetically, with precedence given
to paths closer to the root. So given directories /games and /windows/games,
"mt g" will find /games, since it closer to the root. But with directories
/windows and /windoze, "mt w" will find /windows, since "w" comes before "z".
Possible Enhancements
These are things I will do if I receive any mail requesting them:
more previous directories, but probably no more than 12 (; ;; ;[0-9]);
an add/remove directory (tree) command, rather than rescanning;
minimum characters to uniquely identify current directory;
pop-up window, but only if it's desperate (I WANT A POP-UP WINDOW!!!)
and there's more than ten requests;
Win95 long-filename support - I have the interrupts (thanks to Ralf
Brown's list) but not Win95, so if there's any volunteers...;
whatever else people ask for.
Redistribution
If you're just giving it your mate, only the two com files are necessary.
However, if you plan to upload it to a BBS or FTP site (or whatever), I'd ask
that you upload the original zip-file (or whatever archiver you prefer). If
you modify the source, let me know and I'll redistribute an "official" version
(after all, I still hold copyright), but I have no objections if you distri-
bute both my original code and your modification (but please, do let me know).
Address
e-mail: hoodj@topaz.cqu.edu.au
snail mail: Jason Hood
11 Buckle Street
North Rockhampton
Queensland, 4701
Australia.
Finally
This is not the best document in the world, but I hope it suffices. Please
let me know how it can be improved.
This program is copyrighted Freeware. Feel free to give it to all and sundry
(under the conditions mentioned in "Redistribution"). But if you sell it, I
curse you to everlasting bankruptcy.
Jason Hood, 4 June, 1996.